import { createPinia  } from 'pinia'
 
// 创建pinia实例
const pinia = createPinia()

pinia.use(({ store }) => {
  const initialState = JSON.parse(JSON.stringify(store.$state));
  store.$reset = () => {
      store.$patch(initialState);
  }
})

// 导出pinia实例，给main使用
export default pinia
export * from './user'  //多个模块同理导出